/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.tvunetworks.model;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 *
 * @author michael
 */
public class Item extends BaseObject implements Serializable {

    private String itemId;
    private String productId;
    private BigDecimal listPrice;
    private BigDecimal unitCost;
    private int supplierId;
    private String status;
    private String attribute1;
    private String attribute2;
    private String attribute3;
    private String attribute4;
    private String attribute5;
    private Product product;
    private int quantity;

    public String getItemId() {
        return itemId;
    }

    public void setItemId(String itemId) {
        this.itemId = itemId.trim();
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public int getSupplierId() {
        return supplierId;
    }

    public void setSupplierId(int supplierId) {
        this.supplierId = supplierId;
    }

    public BigDecimal getListPrice() {
        return listPrice;
    }

    public void setListPrice(BigDecimal listPrice) {
        this.listPrice = listPrice;
    }

    public BigDecimal getUnitCost() {
        return unitCost;
    }

    public void setUnitCost(BigDecimal unitCost) {
        this.unitCost = unitCost;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getAttribute1() {
        return attribute1;
    }

    public void setAttribute1(String attribute1) {
        this.attribute1 = attribute1;
    }

    public String getAttribute2() {
        return attribute2;
    }

    public void setAttribute2(String attribute2) {
        this.attribute2 = attribute2;
    }

    public String getAttribute3() {
        return attribute3;
    }

    public void setAttribute3(String attribute3) {
        this.attribute3 = attribute3;
    }

    public String getAttribute4() {
        return attribute4;
    }

    public void setAttribute4(String attribute4) {
        this.attribute4 = attribute4;
    }

    public String getAttribute5() {
        return attribute5;
    }

    public void setAttribute5(String attribute5) {
        this.attribute5 = attribute5;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Item other = (Item) obj;
        if ((this.itemId == null || !this.itemId.equals(other.itemId))) {
            return false;
        }
        if ((this.productId == null || !this.productId.equals(other.productId))) {
            return false;
        }
        if (this.listPrice != other.listPrice && (this.listPrice == null || !this.listPrice.equals(other.listPrice))) {
            return false;
        }
        if (this.unitCost != other.unitCost && (this.unitCost == null || !this.unitCost.equals(other.unitCost))) {
            return false;
        }
        if (this.supplierId != other.supplierId) {
            return false;
        }
        if ((this.status == null || !this.status.equals(other.status))) {
            return false;
        }
        if ((this.attribute1 == null || !this.attribute1.equals(other.attribute1))) {
            return false;
        }
        if ((this.attribute2 == null || !this.attribute2.equals(other.attribute2))) {
            return false;
        }
        if ((this.attribute3 == null || !this.attribute3.equals(other.attribute3))) {
            return false;
        }
        if ((this.attribute4 == null || !this.attribute4.equals(other.attribute4))) {
            return false;
        }
        if ((this.attribute5 == null || !this.attribute5.equals(other.attribute5))) {
            return false;
        }
        if (this.product != other.product && (this.product == null || !this.product.equals(other.product))) {
            return false;
        }
        if (this.quantity != other.quantity) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 97 * hash + (this.itemId != null ? this.itemId.hashCode() : 0);
        hash = 97 * hash + (this.productId != null ? this.productId.hashCode() : 0);
        hash = 97 * hash + (this.listPrice != null ? this.listPrice.hashCode() : 0);
        hash = 97 * hash + (this.unitCost != null ? this.unitCost.hashCode() : 0);
        hash = 97 * hash + this.supplierId;
        hash = 97 * hash + (this.status != null ? this.status.hashCode() : 0);
        hash = 97 * hash + (this.attribute1 != null ? this.attribute1.hashCode() : 0);
        hash = 97 * hash + (this.attribute2 != null ? this.attribute2.hashCode() : 0);
        hash = 97 * hash + (this.attribute3 != null ? this.attribute3.hashCode() : 0);
        hash = 97 * hash + (this.attribute4 != null ? this.attribute4.hashCode() : 0);
        hash = 97 * hash + (this.attribute5 != null ? this.attribute5.hashCode() : 0);
        hash = 97 * hash + (this.product != null ? this.product.hashCode() : 0);
        hash = 97 * hash + this.quantity;
        return hash;
    }

    public String toString() {
        return "(" + getItemId() + "-" + getProductId() + ")";
    }
}

